<template>
	<iframe :src="reportUrl" :style="componentModel.cssStyle" :class="componentModel.cssClass" ref="iframe"></iframe>
</template>

<script>
	import utils from '@/utils/utils.js';
	export default {
		name: "UReport2Component",
		props: ["componentModel"],
		data() {
			return {
				reportUrl: "",
			}
		},
		inject: ['children'],
		mounted() {
			this.children.push(this);
		},beforeUnmount() {
			utils.removeArrayElement(this.children,this);
		},
		methods: {
			setProp(prop) {
				if(prop["content"]==undefined){
					return;
				}
				var document = this.$refs.iframe.contentWindow.document;
				document.body.innerHTML = "";
				var html = "<html><body><style>" + prop["style"] + "</style>" + prop["content"] + "</body></html>";
				document.write(html);
			}
		},
	}
</script>

<style>
</style>
